package com.example.tests;

public class ContactData implements Comparable<ContactData> {
	public String name;
	public String lastname;
	public String mycity;
	public String homePhone;
	public String mobilePhone;
	public String workPhone;
	public String email;
	public String email2;
	public String birthDay;
	public String birthMonth;
	public String birthYear;
	public String address;
	public String homePhone2;

	public ContactData() {
	}
	
	public ContactData(String name1, String lastname1,
			String mycity1, String homephone1, String mobilephone1,
			String workphone1, String email1, String email2, String birthDay, String birthMonth, String birthYear,
			String address1, String homephone2) {
		this.name = name1;
		this.lastname = lastname1;
		this.mycity = mycity1;
		this.homePhone = homephone1;
		this.mobilePhone = mobilephone1;
		this.workPhone = workphone1;
		this.email = email1;
		this.email2 = email2;
		this.birthDay = birthDay;
		this.birthMonth = birthMonth;
		this.birthYear = birthYear;
		this.address = address1;
		this.homePhone2 = homephone2;
	}

	@Override
	public String toString() {
		return "ContactData [lastname=" + lastname + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((lastname == null) ? 0 : lastname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (lastname == null) {
			if (other.lastname != null)
				return false;
		} else if (!lastname.equals(other.lastname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		return this.lastname.toLowerCase().compareTo(other.lastname.toLowerCase());
		
	}

	
	
	
}